<template>
  <div class="b-border w-full flex flex-col justify-between gap-1 overflow-hidden p-x-2 p-y-2">
    <div class="flex justify-between gap-2 overflow-hidden">
      <span class="text-#333 font-600">{{ data.eventDesc }}</span>
      <span class="text-nowrap text-#F7580A font-600">{{ type === '0' ? '+' : '' }}{{ data.score || 0 }}</span>
    </div>
    <div class="flex justify-between gap-2">
      <span class="truncate text-3 text-#999">{{ data.projectName }}</span>
      <span class="text-nowrap text-3 text-#999">{{ dayjs(data.createTime).format('YYYY/MM/DD HH:mm:ss') }}</span>
    </div>
  </div>
</template>

<script lang='ts' setup>
import dayjs from 'dayjs'
import type { IScoreDetail } from '@/api/home/types'

interface Props {
  data: IScoreDetail
  /**
   * 0 获取积分 1 消费积分
   */
  type: '0' | '1'
}

withDefaults(defineProps<Props>(), {
  data: () => ({} as IScoreDetail),
  type: '0',
})
</script>

<style lang='less' scoped>
.b-border {
  border-bottom: 1px solid rgba(153, 153, 153, 0.2);
}
</style>
